FROM python:3.12
RUN pip install Django
RUN pip freeze >requirements.txt
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY pip.conf /root/.pip/pip.conf
COPY requirements.txt /usr/src/app/
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install -r /usr/src/app/requirements.txt
RUN rm -rf /usr/src/app
COPY . /usr/src/app
CMD [ "python", "./app.py", "runserver", "0.0.0.0:8080"]